package bairui.international.console.web.controller.product.property;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

import com.lianjing.sh.project.config.web.Project_Config_Web_PageTemplate;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.module.context.ModuleContext;
import com.lianjing.sh.spring.web.controller.enhance.navigations.context.NavigationContext;

import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemAdd_AddAccess;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemDelete_Delete;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemDetail_DetailAccess;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemDown_Submit;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemEdit_EditAccess;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemExport_ExcelExport;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemImport_ExcelImport;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemPage_Page;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemPublish_Submit;
import bairui.international.console.web.controller.product.property.item.C_Product_Property_PropertyItemUp_Submit;
import bairui.international.model.domain.jpa.TB_ProductProperty;
import bairui.international.service.Service_ProductProperty;

/**
 *
 * 详情
 *
 * @generated
 * 
 * @see STest_C_Product_Property_Detail_DetailAccess 测试
 *
 */
@Controller
public class C_Product_Property_Detail_DetailAccess
 extends SC_Product_Property_Detail_DetailAccess 
{
	
	@Autowired private Service_ProductProperty service_ProductProperty;
	
	/**
	 * 访问详情页面
	 */
	@Action(DetailAccess.class)
	@GetMapping(DetailAccess.RequestMappingValue)
	public ModelAndView detailAccess(
		ModelMap map, HttpServletRequest request,
		NavigationContext navigationContext, ModuleContext moduleContext, 
		@PathVariable(name=DetailAccess.PathVariableName.Id) long id
	) throws Exception {
		TB_ProductProperty bean = service_ProductProperty.findById(id);
		/* 模块 */
		moduleContext
			.addModule(module_Info.module(
					new Module_Info_OutputModel(bean)
				))
			.addModule(this.module_ItemPage.module(
					new C_Product_Property_PropertyItemPage_Page.Page.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
					}, 
					new C_Product_Property_PropertyItemAdd_AddAccess.AddAccess.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
					}, 
					new C_Product_Property_PropertyItemImport_ExcelImport.ExcelImport.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
					},  
					new C_Product_Property_PropertyItemExport_ExcelExport.ExcelExport.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
					},  
					new C_Product_Property_PropertyItemDetail_DetailAccess.DetailAccess.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					},  
					new C_Product_Property_PropertyItemEdit_EditAccess.EditAccess.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					},  
					new C_Product_Property_PropertyItemDelete_Delete.Delete.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					},  
					new C_Product_Property_PropertyItemPublish_Submit.Submit.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					},  
					new C_Product_Property_PropertyItemUp_Submit.Submit.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					},  
					new C_Product_Property_PropertyItemDown_Submit.Submit.Operate(){
						@Override public Object getPropertyId() {
							return id;
						}
						@Override public Object getId() {
							return "{{:id}}";
						}
					}
				));
		//
		return Project_Config_Web_PageTemplate.Admin_Common(request);
	}
	

}
